package day07.ZiXi;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ExceptionDemo {
    public static void main(String[] args)throws ParseException {
        System.out.println("开始");
        //method();
        method2();

        System.out.println("结束");
    }
//编译异常
    private static void method2() throws ParseException {
        String s = "2014-05-24";
        SimpleDateFormat zxc = new SimpleDateFormat("yyyy-MM-dd");
        Date d = zxc.parse(s);
        System.out.println(d);
    }

    public static void method(String[] args) throws ArrayIndexOutOfBoundsException{
        int[] arr = {1,2,3};
        System.out.println(arr[3]);

    }
}
